package com.chenyun.boot.datasource.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class SimpleEntity {


    /** 创建时间
     * fill = FieldFill.INSERT_UPDATE 指定自动填充字段类型 \
     * 需要实现mybatis-plus的MetaObjectHandler 接口
     *
     * */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @TableField("del_flag")
    @TableLogic()
    private boolean delFlag;

    @TableField(
            fill = FieldFill.UPDATE
    )
    private Long revision;
    @TableField(
            fill = FieldFill.INSERT
    )
    private String tenantId;


    /**
     * 用于存储反射 或则其它额外字段
     */
    @TableField(exist = false)
    private Map<String, Object> params=new HashMap<>();

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public boolean isDelFlag() {
        return delFlag;
    }

    public void setDelFlag(boolean delFlag) {
        this.delFlag = delFlag;
    }

    public Long getRevision() {
        return revision;
    }

    public void setRevision(Long revision) {
        this.revision = revision;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }



}
